import sqlite3

def search_demo(sql):
    try:
        conn = sqlite3.connect('demo.db')
        cur = conn.cursor()
        cur.execute(sql)
        resList = cur.fetchall()
    finally:
        conn.close()
    return resList

def insert_demo(sql):
    try:
        conn = sqlite3.connect('demo.db')
        cur = conn.cursor()
        cur.execute(sql)
        conn.commit()
    except:
        conn.rollback()
    finally:
        conn.close()









